 <meta charset="utf-8">
 <div class="box box-primary" id="app_authPermission_edit" style="max-width: 1200px;"> 
     <form role="form"  id="editForm" >
            <div class="box-body" > 
			      <div class="form-group">
                  <label for="permCode" class="control-label">权限编码</label>
                  <input type="text" v-model="authPermission.permCode"  name="permCode" class="form-control" id="permCode" placeholder="请输入权限编码" required />
                </div>
			    <div class="form-group" >
                  <label for="name" class="control-label">权限名称</label>
                  <input type="text" v-model="authPermission.name" name="name"  class="form-control" id="name" placeholder="请输入权限名称"  required/>
                </div>
			
                  <div class="form-group">
					<label for="name" class="control-label">所属应用</label>
                  	<select id="appKey" v-model="authPermission.appKey" name="appKey" v-kselect="{url:'auth/authApp/loadAuthAppComboboVo',vmodel:'authPermission.appKey',firstEmpty:'false'}" class=" form-control"   required> </select>
				</div> 
				
				 <div class="form-group">
					<label for="name" class="control-label">所属模块</label>
					 <select id="moduleId" v-model="authPermission.moduleId"  name="moduleId" v-kselect="{url:'auth/authModule/loadModuleComboboVo',vmodel:'authPermission.moduleId',linkToDomId:'appKey',ajaxParamKey:'appKey',firstEmpty:'true'}" class=" form-control"> </select>
				</div> 
				
                 <div class="form-group">
	                  <label for="authPermission.enabled" >权限状态 </label>
	                   <select v-model="authPermission.enabled" name="enabled" class="form-control"  required >
					    <option  value="true">启 用</option>
					    <option value="false">禁 用</option>
					  </select>
                </div>
				
			   <div class="form-group">
                  <label for="url" class="control-label">权限地址</label>
                  <input type="text" v-model="authPermission.url"  name="url" class="form-control" id="url" placeholder="请输入权限地址"  required/>
                </div>
                
			  <div class="form-group" id="description_div">
                  <label for="description" class="control-label">权限备注</label>
                  <input type="text" v-model="authPermission.description" name="description"  class="form-control" id="description" placeholder="请输入权限描述"  required/>
                </div>
                
                </div>
            <div class="box-footer">
                 <button type="button" class="btn btn-default" v-on:click="cancle">取消</button>
                 <button type="button" class="btn btn-info pull-right"  v-on:click="edit">提交</button>
              </div> 
       </form>
</div>
<script type="text/javascript">
var news= new Vue({
    el: '#app_authPermission_edit',
    data: {
    	authPermission:{
    		id:'',
    		permCode:'',
    		name:'',
    		appKey:'',
    		moduleId:'',
    		enabled:'',
    		url:'',
    		type:'',
    		description:''
    	},
    	bus:new Vue()
     },
     mounted:function(){
     },
     methods: {
    	 edit: function () {
    	    	if($("#editForm").valid()){
    	    		let _this=this;
    	    		let url="auth/authPermission/addPermission";
    	    		zfesAjax.ajaxTodo(url,_this.$data.authPermission, function(data){
    	    			alertSwal.successText(data.message);
    	    			layer.close(layer.index);
    	    		})
    	    	}
    	    },
    	    cancle:function(){
    	    	 layer.close(layer.index);
    	    }
    }
});
</script>
